import tkinter as tk

window = tk.Tk()
window.title("小A君")
window.geometry("200x200")

l = tk.Label(window,bg="yellow",width=20,text="empty")
'''width表示字符宽度'''
l.pack()

def print_selection(v):
    l.config(text="you have selected "+v)

s = tk.Scale(window,label="try me",from_=5,to=11,
orient=tk.HORIZONTAL,length=200,showvalue=1,
tickinterval=3,resolution=0.01,command=print_selection)
'''showvalue表示是否显示数值1是0否
tickinterval表示数字间隔
resolution表示精度'''
s.pack()

window.mainloop()
'''不断循环刷新'''

